Skip to content

Conversation

@hauntsaninja
Copy link
Owner

No description provided.

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja changed the title tmp equal literal Nov 14, 2024
@github-actions

This comment has been minimized.

@github-actions
Copy link

Diff from mypy_primer, showing the effect of this PR on open source code:

hydpy (https://github.com/hydpy-dev/hydpy)
+ hydpy/exe/xmltools.py:2335: error: Incompatible types in assignment (expression has type "str", variable has type "Literal['nodes']")  [assignment]
+ hydpy/auxs/armatools.py:271: error: Right operand of "and" is never evaluated  [unreachable]
+ hydpy/auxs/armatools.py:272: error: Statement is unreachable  [unreachable]

optuna (https://github.com/optuna/optuna)
+ tests/samplers_tests/test_qmc.py:115: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/samplers_tests/test_qmc.py:145: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_qmc.py:166: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_nsgaiii.py:238: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_nsgaii.py:716: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_nsgaii.py:754: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_samplers.py:781: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/samplers_tests/test_samplers.py:805: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/trial_tests/test_trial.py:260: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/study_tests/test_study.py:1245: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[3]")  [comparison-overlap]

psycopg (https://github.com/psycopg/psycopg)
+ tests/test_capabilities.py:99: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null_async.py:144: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null_async.py:194: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool_async.py:198: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_async.py:222: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool_async.py:680: error: Non-overlapping equality check (left operand type: "Literal[4]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null.py:145: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null.py:195: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool.py:198: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool.py:222: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool.py:679: error: Non-overlapping equality check (left operand type: "Literal[4]", right operand type: "Literal[2]")  [comparison-overlap]

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/frame.py:3452: error: Unused "type: ignore" comment  [unused-ignore]

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/deploy/_actions.py:193: error: No overload variant of "__setitem__" of "list" matches argument types "str", "list[dict[str, dict[str, Any]]]"  [call-overload]
- src/prefect/cli/deploy/_actions.py:193: note: Possible overload variants:
- src/prefect/cli/deploy/_actions.py:193: note:     def __setitem__(self, SupportsIndex, dict[str, Any], /) -> None
- src/prefect/cli/deploy/_actions.py:193: note:     def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None
- src/prefect/cli/deploy/_actions.py:201: error: No overload variant of "__setitem__" of "list" matches argument types "str", "list[dict[str, dict[str, Any]]]"  [call-overload]
- src/prefect/cli/deploy/_actions.py:201: note: Possible overload variants:
- src/prefect/cli/deploy/_actions.py:201: note:     def __setitem__(self, SupportsIndex, dict[str, Any], /) -> None
- src/prefect/cli/deploy/_actions.py:201: note:     def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/connector.py:1315:25: error: Statement is unreachable  [unreachable]
+ aiohttp/connector.py:1315:25: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-unreachable for more info

starlette (https://github.com/encode/starlette)
+ tests/test_datastructures.py:317: error: Non-overlapping equality check (left operand type: "Literal[4]", right operand type: "Literal[19]")  [comparison-overlap]
+ tests/test_datastructures.py:350: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[4]")  [comparison-overlap]
+ tests/test_testclient.py:160: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[3]")  [comparison-overlap]
+ tests/test_responses.py:124: error: Non-overlapping equality check (left operand type: "Literal['']", right operand type: "Literal['6, 7, 8, 9']")  [comparison-overlap]
+ tests/test_responses.py:247: error: Non-overlapping equality check (left operand type: "Literal['']", right operand type: "Literal['6, 7, 8, 9']")  [comparison-overlap]
+ tests/test_applications.py:535: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]

operator (https://github.com/canonical/operator)
- ops/pebble.py:1171: error: TypedDict key must be a string literal; expected one of ("command", "service-context", "environment", "user-id", "user", ...)  [literal-required]
- ops/pebble.py:1189: error: TypedDict key must be a string literal; expected one of ("url", "headers")  [literal-required]
+ ops/pebble.py:3506: error: Redundant cast to "Literal['response', 'files']"  [redundant-cast]

core (https://github.com/home-assistant/core)
+ homeassistant/util/color.py:410: error: Statement is unreachable  [unreachable]
+ homeassistant/util/color.py:574: error: Statement is unreachable  [unreachable]
+ homeassistant/core.py:1002: error: Statement is unreachable  [unreachable]
+ homeassistant/helpers/script.py:1212: error: Statement is unreachable  [unreachable]
+ homeassistant/helpers/script.py:1268: error: Statement is unreachable  [unreachable]
+ homeassistant/components/awair/config_flow.py:225: error: Argument "errors" to "async_show_form" of "ConfigFlow" has incompatible type "dict[str, Literal['invalid_access_token']]"; expected "dict[str, str] | None"  [arg-type]
+ homeassistant/components/awair/config_flow.py:225: note: "dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ homeassistant/components/awair/config_flow.py:225: note: Consider using "Mapping" instead, which is covariant in the value type
+ homeassistant/components/mold_indicator/sensor.py:418: error: Statement is unreachable  [unreachable]
+ homeassistant/components/airtouch5/cover.py:122: error: Statement is unreachable  [unreachable]
+ homeassistant/components/history/websocket_api.py:259: error: Statement is unreachable  [unreachable]
+ homeassistant/components/mqtt/light/schema_basic.py:428: error: Statement is unreachable  [unreachable]

CPython (cases_generator) (https://github.com/python/cpython)
+ Tools/cases_generator/tier2_generator.py:204: error: Non-overlapping equality check (left operand type: "Literal['IDENTIFIER']", right operand type: "Literal['SEMI']")  [comparison-overlap]
+ Tools/cases_generator/tier2_generator.py:205: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "Literal['LOAD_IP']"  [arg-type]

pytest (https://github.com/pytest-dev/pytest)
+ testing/test_monkeypatch.py:41: error: Non-overlapping equality check (left operand type: "Literal[2]", right operand type: "Literal[3]")  [comparison-overlap]
+ testing/test_monkeypatch.py:42: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:50: error: Unused "type: ignore" comment  [unused-ignore]
+ testing/test_monkeypatch.py:72: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:115: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[5]")  [comparison-overlap]
+ testing/test_monkeypatch.py:116: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:129: error: Non-overlapping equality check (left operand type: "Literal[2]", right operand type: "Literal[3]")  [comparison-overlap]
+ testing/test_monkeypatch.py:130: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:429: error: Non-overlapping equality check (left operand type: "Literal[2]", right operand type: "Literal[1]")  [comparison-overlap]
+ testing/test_doctest.py:1615: error: Statement is unreachable  [unreachable]
+ testing/test_doctest.py:1619: error: Unused "type: ignore" comment  [unused-ignore]
+ testing/test_doctest.py:1620: error: Statement is unreachable  [unreachable]
+ testing/test_compat.py:138: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ testing/test_compat.py:139: error: Statement is unreachable  [unreachable]
+ testing/logging/test_fixture.py:177: error: Non-overlapping equality check (left operand type: "Literal[50]", right operand type: "Literal[20]")  [comparison-overlap]
+ testing/logging/test_fixture.py:179: error: Statement is unreachable  [unreachable]
+ testing/logging/test_fixture.py:183: error: Statement is unreachable  [unreachable]
+ testing/code/test_excinfo.py:1059: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[3]")  [comparison-overlap]

rich (https://github.com/Textualize/rich)
+ rich/progress.py:1033: error: Statement is unreachable  [unreachable]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/pytables.py:4825: error: Item "Index" of "ndarray[tuple[Any, ...], dtype[Any]] | Index" has no attribute "reshape"  [union-attr]
+ pandas/io/formats/format.py:246: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[1]")  [assignment]

discord.py (https://github.com/Rapptz/discord.py)
- discord/mentions.py:126: error: Item "bool" of "bool | Sequence[Snowflake]" has no attribute "__iter__" (not iterable)  [union-attr]
- discord/mentions.py:131: error: Item "bool" of "bool | Sequence[Snowflake]" has no attribute "__iter__" (not iterable)  [union-attr]
- discord/mentions.py:134: error: Incompatible types in assignment (expression has type "bool", target has type "list[Any | int]")  [assignment]
+ discord/mentions.py:134: error: Incompatible types in assignment (expression has type "bool", target has type "list[int]")  [assignment]
- discord/mentions.py:136: error: Incompatible types in assignment (expression has type "list[str]", target has type "list[Any | int]")  [assignment]
+ discord/mentions.py:136: error: Incompatible types in assignment (expression has type "list[str]", target has type "list[int]")  [assignment]

trio (https://github.com/python-trio/trio)
+ src/trio/_tests/test_fakenet.py:193: error: Unused "type: ignore" comment  [unused-ignore]

black (https://github.com/psf/black)
+ src/blib2to3/pgen2/pgen.py:287:13: error: Statement is unreachable  [unreachable]

pyodide (https://github.com/pyodide/pyodide)
+ pyodide-build/pyodide_build/pywasmcross.py:332: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "Literal['Symbol {']"  [arg-type]
+ pyodide-build/pyodide_build/tests/test_xbuildenv.py:87: error: Statement is unreachable  [unreachable]
+ pyodide-build/pyodide_build/tests/recipe/test_bash_runner.py:28: error: Non-overlapping equality check (left operand type: "Literal['2']", right operand type: "Literal['7']")  [comparison-overlap]

jinja (https://github.com/pallets/jinja)
+ src/jinja2/parser.py:394: error: Non-overlapping equality check (left operand type: "Literal['name']", right operand type: "Literal['comma']")  [comparison-overlap]
+ src/jinja2/ext.py:481: error: Non-overlapping equality check (left operand type: "Literal['block_begin']", right operand type: "Literal['name']")  [comparison-overlap]

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/exchanges/binance.py:387: error: Statement is unreachable  [unreachable]
+ rotkehlchen/chain/ethereum/modules/sushiswap/decoder.py:214: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/unit/test_tasks_manager.py:1244: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/api/blockchain/test_base.py:318: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/api/test_exchanges.py:643: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/api/test_exchanges.py:768: error: Statement is unreachable  [unreachable]

static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/interface.py:596: error: Incompatible types in assignment (expression has type "str", variable has type "Literal['values']")  [assignment]
+ static_frame/core/interface.py:1520: error: Incompatible types in assignment (expression has type "str", variable has type "Literal['values']")  [assignment]
+ static_frame/core/interface.py:1541: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1543: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1545: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1590: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1595: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1600: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1605: error: Statement is unreachable  [unreachable]

cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/url_helper.py:560: error: Invalid index type "str" for "dict[Literal['headers'], Any]"; expected type "Literal['headers']"  [index]
+ tests/unittests/sources/test_maas.py:269: error: Statement is unreachable  [unreachable]

artigraph (https://github.com/artigraph/artigraph)
+ tests/arti/graphs/test_graph.py:156: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/arti/graphs/test_graph.py:305: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]

AutoSplit (https://github.com/Toufool/AutoSplit)
+ src/utils.py:337:57: error: Non-overlapping equality check (left operand type: "Literal['linux']", right operand type: "Literal['win32']")  [comparison-overlap]
+ src/capture_method/__init__.py:121:4: error: Non-overlapping equality check (left operand type: "Literal['linux']", right operand type: "Literal['win32']")  [comparison-overlap]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants